From 2e8dcebd14aa2e7034ef5643adc579bb72806ccc Mon Sep 17 00:00:00 2001
From: Daniel Kolesa <daniel@octaforge.org>
Date: Fri, 25 Feb 2022 00:36:43 +0100
Subject: [PATCH 05/11] get rid of wrong linkage

There is no good way to compute the clang builtins library
path from inside the rust code, but there should be no harm
in just disabling nodefaultlibs for our platform.
---
 vendor/libc-0.2.135/src/unix/mod.rs | 7 +------
 vendor/libc-0.2.137/src/unix/mod.rs | 7 +------
 vendor/libc/src/unix/mod.rs         | 7 +------
 3 files changed, 3 insertions(+), 18 deletions(-)

diff --git a/vendor/libc-0.2.135/src/unix/mod.rs b/vendor/libc-0.2.135/src/unix/mod.rs
index ecc693e3d..b3cb2ea0f 100644
--- a/vendor/libc-0.2.135/src/unix/mod.rs
+++ b/vendor/libc-0.2.135/src/unix/mod.rs
@@ -337,12 +337,7 @@ cfg_if! {
         #[link(name = "c", cfg(not(target_feature = "crt-static")))]
         extern {}
     } else if #[cfg(target_env = "musl")] {
-        #[cfg_attr(feature = "rustc-dep-of-std",
-                   link(name = "c", kind = "static", modifiers = "-bundle",
-                        cfg(target_feature = "crt-static")))]
-        #[cfg_attr(feature = "rustc-dep-of-std",
-                   link(name = "c", cfg(not(target_feature = "crt-static"))))]
-        extern {}
+        // we don't set -nodefaultlibs, so no need to link anything
     } else if #[cfg(target_os = "emscripten")] {
         #[link(name = "c")]
         extern {}
diff --git a/vendor/libc-0.2.137/src/unix/mod.rs b/vendor/libc-0.2.137/src/unix/mod.rs
index 16b69bb86..5e0062634 100644
--- a/vendor/libc-0.2.137/src/unix/mod.rs
+++ b/vendor/libc-0.2.137/src/unix/mod.rs
@@ -337,12 +337,7 @@ cfg_if! {
         #[link(name = "c", cfg(not(target_feature = "crt-static")))]
         extern {}
     } else if #[cfg(target_env = "musl")] {
-        #[cfg_attr(feature = "rustc-dep-of-std",
-                   link(name = "c", kind = "static", modifiers = "-bundle",
-                        cfg(target_feature = "crt-static")))]
-        #[cfg_attr(feature = "rustc-dep-of-std",
-                   link(name = "c", cfg(not(target_feature = "crt-static"))))]
-        extern {}
+        // we don't set -nodefaultlibs, so no need to link anything
     } else if #[cfg(target_os = "emscripten")] {
         #[link(name = "c")]
         extern {}
diff --git a/vendor/libc/src/unix/mod.rs b/vendor/libc/src/unix/mod.rs
index fb9ebf792..cd6968344 100644
--- a/vendor/libc/src/unix/mod.rs
+++ b/vendor/libc/src/unix/mod.rs
@@ -339,12 +339,7 @@ cfg_if! {
         #[link(name = "c", cfg(not(target_feature = "crt-static")))]
         extern {}
     } else if #[cfg(target_env = "musl")] {
-        #[cfg_attr(feature = "rustc-dep-of-std",
-                   link(name = "c", kind = "static", modifiers = "-bundle",
-                        cfg(target_feature = "crt-static")))]
-        #[cfg_attr(feature = "rustc-dep-of-std",
-                   link(name = "c", cfg(not(target_feature = "crt-static"))))]
-        extern {}
+        // we don't set -nodefaultlibs, so no need to link anything
     } else if #[cfg(target_os = "emscripten")] {
         #[link(name = "c")]
         extern {}
-- 
2.39.0

